export default function useClientAttrs() {
	//获取屏幕宽度
	const clientWidth = ref(0);
	const clientHeight = ref(0);
	function handleResize() {
		clientWidth.value = window.innerWidth;
		clientHeight.value = window.innerHeight;
	}
	onMounted(async () => {
		// 监听窗口大小变化
		await nextTick();
		await window.addEventListener("resize", debounce(handleResize, 100));
	});
	onUnmounted(async () => {
		await window.removeEventListener("resize", handleResize);
	});
	return {
		clientWidth,
		clientHeight
	};
}
